#pragma once

#include <string>

namespace WordMemory
{
    class Except : public std::exception
    {
    public:
        Except(const std::string& msg) : s(msg)
        {}

        const char* what() const throw()
        {
            return s.c_str();
        }

        std::string s;
    };

    class ConfigExcept : public Except
    {
    public:
        ConfigExcept(const std::string& msg) : Except("config_except::" + msg)
        {}
    };

    class UtilExcept : public Except
    {
    public:
        UtilExcept(const std::string& msg) : Except("util_except::" + msg)
        {}
    };

    class ServerExcept : public Except
    {
    public:
        ServerExcept(const std::string& msg) : Except("server_except::" + msg)
        {}
    };

    class ControllerExcept : public ServerExcept
    {
    public:
        ControllerExcept(const std::string& msg) : ServerExcept("controller_except::" + msg)
        {}
    };

    class ServiceExcept : public ServerExcept
    {
    public:
        ServiceExcept(const std::string& msg) : ServerExcept("service_except::" + msg)
        {}
    };

    class RepositoryExcept : public ServerExcept
    {
    public:
        RepositoryExcept(const std::string& msg) : ServerExcept("repository_except::" + msg)
        {}
    };
}